function getQueryString(name){
  var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if(r!=null)return  unescape(r[2]); return null;
}


$(function(){ 
　　$(".side-ul li").click(function(){ 
       var id=$(this).index()
       const urlParm=['index','purchase','sell']
       window.location.href=urlParm[id]
　　}); 
});

window.url = 'http://localhost:8085';
window.localurl = 'http://localhost:8082';

let token = 'Bearer ';

// axios封装get请求
function axiosGetRequst(url, data) {
    let result = axios({
        method: 'get',
        url: window.url + url,
        data: data,
        headers: {
            'Content-Type': 'application/json',
            // 'Set-Cookie': window.localStorage['token']
        }
    }).then(resp => {
        return resp.data;
    }).catch(function (error) {
        return 'exception = ' + error;
    });
    return result;
}

function axiosPostFormDataRequest(url, data) {
    // axios.default.headers.token = window.localStorage['token'];
    let result = axios({
        method: 'post',
        url: window.url + url,
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data',
            'Authorization': window.localStorage['token']
        }
    }).then(resp => {
        return resp.data;
    }).catch(function (error) {
        return 'exception = ' + error;
    });
    return result;
}

// axios封装post请求
function axiosPostRequest(url, data) {
    // axios.default.headers.token = window.localStorage['token'];
    let result = axios({
        method: 'post',
        url: window.url + url,
        data: data,
        headers: {
            'Content-Type': 'application/json',
            'Authorization': window.localStorage['token']
        }
    }).then(resp => {
        return resp.data;
    }).catch(function (error) {
        return 'exception = ' + error;
    });
    return result;
}

const model_versionOptions = [
    {
    value: '0.5.3',
    label: '0.5.3'
    },
    // {
    // value: '0.5.3',
    // label: '0.5.3'
    // }
];